<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html>
<head>



    <meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<title><?php echo ($seo_title); ?></title>
<meta name="keywords" content="<?php echo ($seo_keywords); ?>" />
<meta name="description" content="<?php echo ($seo_description); ?>" />


<!-- Set render engine for 360 browser -->
<meta name="renderer" content="webkit">

<!-- No Baidu Siteapp-->
<meta http-equiv="Cache-Control" content="no-siteapp"/>

<link rel="icon" type="image/png" href="/Statics/Home/img/favicon.png">

<!-- Add to homescreen for Chrome on Android -->
<meta name="mobile-web-app-capable" content="yes">
<link rel="icon" sizes="192x192" href="/Statics/Home/img/app-icon72x72@2x.png">

<!-- Add to homescreen for Safari on iOS -->
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="apple-mobile-web-app-title" content="PLAZOTTA"/>
<link rel="apple-touch-icon-precomposed" href="/Statics/Home/img/app-icon72x72@2x.png">

<!-- Tile icon for Win8 (144x144 + tile color) -->
<meta name="msapplication-TileImage" content="/Statics/Home/img/app-icon72x72@2x.png">
<meta name="msapplication-TileColor" content="#0e90d2">

    <link rel="stylesheet" href="/Statics/Home/css/amazeui.min.css">
<link rel="stylesheet" href="/Statics/Home/css/reset.css">
<link rel="stylesheet" href="/Statics/Home/css/common.css">
<link rel="stylesheet" href="/Statics/Home/css/button.css">

<link rel="stylesheet" href="/Statics/Home/js/sco/css/scojs.css" />






</head>
<body style="background:#fafafc">


<div class="weui_navbar" style="height:44px;">
    <div class="weui_navbar_item <?php if($nav == 'cart'): ?>active<?php endif; ?> ">
        <a href="/Home/Cart/index.html">购物车</a>
    </div>
    <div class="weui_navbar_item  <?php if($nav == 'gouwu_log'): ?>active<?php endif; ?>">
        <a href="/User/Order/log.html">购物记录</a>
    </div>
    <div class="weui_navbar_item <?php if($nav == 'hongbao'): ?>active<?php endif; ?>">
        <a href="/User/Yhj/index.html"> 我的红包</a>
    </div>
    <!--<div class="weui_navbar_item <?php if($nav == 'fanxian'): ?>active<?php endif; ?>">-->
        <!--<a href="/User/Fanxian/index.html">我的返现</a>-->
    <!--</div>-->
</div>

<?php if($cartlist['num']): ?><form method="post" class="form-horizontal J_ajaxForm" action='<?php echo U("User/Order/check");?>'>

    <div class="am-cf  am-padding-0 am-margin-top-sm">


        <?php if(is_array($cartlist["data"])): $i = 0; $__LIST__ = $cartlist["data"];if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$v): $mod = ($i % 2 );++$i;?><div class="  am-g cart-list-item common-border-bottom  am-margin-vertical-sm  common-border-top common-border-bottom ">


                <div class="am-u-sm-1 am-text-center">
                    <label class="am-checkbox-inline">
                    <input type="checkbox" class="ids" name="product_id[]"  value="<?php echo ($v["id"]); ?>" data-am-ucheck>
                </label></div>
                <div class="am-u-sm-4 am-text-center  list_img"><img src="<?php echo ($v["thumb"]); ?>" class="am-img-responsive"></div>
                <div class="am-u-sm-3 am-text-xs am-padding-left-0">




                    <a href="<?php echo U('Home/Product/show',array('id'=>$v['product_id']));?> " class="">
                        <h3 class="am-margin-0">
                        <?php echo ($v["title"]); ?></h3>
                        <div class="sku am-text-999" >

                           外框: <?php echo F('Var_waikuang')[$v["waikuang"]][name];?></div>
                    </a>







                </div>


                <div class="am-u-sm-3 am-text-right am-padding-0">




                    <div class="">


                        <?php if($u[vip]): ?><span class="am-text-danger am-text-sm"> ￥ <span class="auto_price"><?php echo ($v["price_huiyuan"]); ?></span></span>
                            <?php else: ?>
                            <span class="am-text-danger am-text-sm"> ￥ <span class="auto_price"><?php echo ($v["price"]); ?></span></span><?php endif; ?>



                    </div>
                    <div class="cart-num">
x1

                        <!--<div class="am-input-group">-->
      <!--<span class="am-input-group-btn jian">-->
        <!--<button class="am-btn am-btn-default  " type="button">-->
            <!--<span class="am-icon-minus"></span></button>-->
      <!--</span>-->
                            <input type="hidden" min="0" name="product[<?php echo ($key); ?>]"
                                   class="am-form-field am-input-xs auto_num " value="<?php echo ($v["num"]); ?>" min="0"
                                   max="999" maxlength="3">



                                 <!--<span class="am-input-group-btn jia">-->
        <!--<button class="am-btn am-btn-default  " type="button" >-->
            <!--<span class="am-icon-plus"></span></button>-->
      <!--</span>-->
                        <!--</div>-->

                    </div>




                </div>



                <div class="am-u-sm-1 am-text-center am-padding-0">




                    <a class=" am-margin-top-lg  cart-del am-text-center" href='<?php echo U("cart_dell",array("product_id"=>$key));?>' style=" border: 1px  solid #666 ; border-radius:10px; width: 20px ;height:20px; display: inline-block; line-height: 18px ">
                        ×

                    </a>

                </div>
                </div><?php endforeach; endif; else: echo "" ;endif; ?>



    </div>







    <div data-am-widget="navbar" class="am-navbar am-cf am-navbar-index  common-border-top "
          style="height: 107px;">
        <div class="order-from-bottom am-text-right common-border-bottom " style="position:relative">

            <label class="am-checkbox-inline" style="position: absolute ; left: 10px; top: 15px;">
                <input type="checkbox" class="check-all "  value="" data-am-ucheck> &nbsp; 全选
            </label>

            <span class="am-margin-right-sm"> 合计：<span class="am-text-f60 " id="z_price">￥0</span></span>


            <button    class="am-btn  am-btn-danger am-btn-xl  " type="submit"   >结算</button>


        </div>
        

<section class="weui-menu am-text-xs" >
    <div class="weui-menu-inner">

        <a href="/"  <?php if($nav == 'home'): ?>class="active"<?php endif; ?>> <span class="bujinhua am-text-xl">&#xe807;</span></a>



    </div>
    <div class="weui-menu-inner">

        <a href="/Home/Product/index" <?php if($nav == 'product'): ?>class="active"<?php endif; ?>>

        <i class="am-icon-navicon"></i>
            <span class="am-navbar-label">全部商品</span>
        </a>

    </div>
    <div class="weui-menu-inner">

        <a href="/Home/Cart/index.html" <?php if($nav == 'cart'): ?>class="active"<?php endif; ?>>
            <span class="am-navbar-label">购物车</span>
        </a>
    </div>
    <div class="weui-menu-inner">

        <a href="/User" <?php if($nav == 'user'): ?>class="active"<?php endif; ?>>
            <span class="am-navbar-label">个人中心</span>
        </a>
        <!--<span>上线测试</span>-->
        <!--<ul>-->
            <!--<em></em>-->
            <!--<li>百度地图</li>-->
            <!--<li>百度一下</li>-->
            <!--<li>百度智能</li>-->
        <!--</ul>-->
    </div>


</section>
    </div>
    </form>

<?php else: ?>



    <div class=" am-text-center  am-margin-vertical-lg am-padding-vertical-lg">


        <p>购物车块饿瘪了T.T</p>
        <p>快给我挑点宝贝吧</p>


        <a href="/Product/index" class=" btn-write am-padding-xs am-padding-horizontal-lg">去逛逛</a>


    </div><?php endif; ?>







<!--[if lt IE 9]>
<script src="/Statics/Home/js/jquery.11.1.js"></script>
<script src="/Statics/Home/js/modernizr.js"></script>
<script src="/Statics/Home/js/amazeui.ie8polyfill.min.js"></script>
<![endif]-->

<!--[if (gte IE 9)|!(IE)]><!-->
<script src="/Statics/Home/js/jquery.min.js"></script>
<!--<![endif]-->
<script src="/Statics/Home/js/amazeui.min.js"></script>




<script src="/Statics/Home/js/sco/js/sco.message.js"></script>
<script src="/Statics/Home/js/common.js"></script>

<script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
<script>


    wx.config({
                debug: false,
                appId: '<?php echo ($jssign["appId"]); ?>',
                timestamp: '<?php echo ($jssign["timestamp"]); ?>',
            nonceStr: '<?php echo ($jssign["nonceStr"]); ?>',
            signature: '<?php echo ($jssign["signature"]); ?>',
            jsApiList: ['onMenuShareTimeline','onMenuShareAppMessage']
    });

    var imgUrl='<?php echo ($imgUrl); ?>';
    var timeLineLink= '<?php echo ($timeLineLink); ?>';
    var tTitle= "<?php echo ($tTitle); ?>";
    var tContent= "<?php echo ($tContent); ?>";


    wx.ready(function () {



        wx.onMenuShareTimeline({
            title: tTitle, // 分享标题
            link:  timeLineLink, // 分享链接
            imgUrl:  imgUrl, // 分享图标
            success: function () {
                // 用户确认分享后执行的回调函数
            },
            cancel: function () {
                // 用户取消分享后执行的回调函数
            }
        });

        wx.onMenuShareAppMessage({
            title:  tTitle, // 分享标题
            desc:  tContent, // 分享描述
            link:  timeLineLink, // 分享链接
            imgUrl:  imgUrl, // 分享图标
            type: '', // 分享类型,music、video或link，不填默认为link
            dataUrl: '', // 如果type是music或video，则要提供数据链接，默认为空
            success: function () {
                // 用户确认分享后执行的回调函数
            },
            cancel: function () {
                // 用户取消分享后执行的回调函数
            }
        });



    }, false);

</script>


<script>





    $(document).on("click",".cart-del",function(){

        var that=$(this);


        $.ajax({
            type: "GET",
            url: $(this).attr('href'),
            data: "att="+$(this).data('href'),
            success: function(data){


                if (data.status == '1') {
//                    $.scojs_message(data.info, $.scojs_message.TYPE_OK);

                    that.parents(".cart-list-item").remove();


                    s_check();
                }else{

                    $.scojs_message(data.info, $.scojs_message.TYPE_ERROR);
                }

            }

        });

        return false;

    });


    $(function(){


        s_check();




        $(".jia").click(function(){
            var input=$(this).prev(".auto_num");
            var n=input.val();
            var num=parseInt(n)+1;
            if(num==0){ return;}
            input.val(num);
            s_check();

        });

        //减的效果
        $(".jian").click(function(){
            var input=$(this).next(".auto_num");
            var n=input.val();
            var num=parseInt(n)-1;
            if(num==0){ return}
            input.val(num);
            s_check();
        });





    })



    function  s_check(){
        var sum=0;
        var sum_price=0;


        $(".cart-list-item ").each(function(){
//                $(this).hide();
            var v=$(this).val();


            num=$(this).find(".auto_num").val()





            price=$(this).find(".auto_price").html()




            price=parseInt(price);


            sum_price=sum_price+price*num;


        })



        $("#z_price").html("￥:"+sum_price);



    }


</script>

</body>
</html>